package com.youku.component.procedure;

import java.sql.SQLException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.youku.component.result.ExecuteResult;
import com.youku.component.result.UpdateExecuteResult;

public class UpdateSQLExecutor extends SQLExecutor {
	
	private static final Logger logger=LoggerFactory.getLogger(UpdateSQLExecutor.class);

	@Override
	protected ExecuteResult execute() {
		try {
			int rs = prepareStatement().executeUpdate();
			logger.info("向数据库发送了更新sql语句:{},执行结果为:{}",sql,rs);
			return new UpdateExecuteResult(rs);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}
}
